#!/usr/bin/env python3.10.6
# -*- coding: utf-8 -*-
# Author: Bobby Sheng <Bobby@sky-cloud.net>

from units.jira_clent import get_jira_client
from units.get_config_data import get_config_yaml_data
import jsonpath

Config = get_config_yaml_data()


def search_issues_status(key: str):
    """
    通过工单key获取工单基本数据
    :return:
    """
    issue_info = get_jira_client().issue(key).fields
    issues_info_data = {
        "issuetype": issue_info.issuetype,
        "summary": issue_info.summary,
        "assignee": issue_info.assignee,
        "reporter": issue_info.reporter,
        "priority": issue_info.priority,
        "status": issue_info.status
    }
    return issues_info_data


if __name__ == '__main__':
    search_issues_status("INET-1599")
